package com.lvyh.lightframe.tracer.core.context.threadlocal;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ExecutorHelper {
    static ExecutorService executor = Executors.newFixedThreadPool(4);

    public static final void execute(Runnable task) {
        // Modify the task before submitting it to the real execution thread pool
        executor.execute(wrap(task));
    }

    private static final Runnable wrap(Runnable task) {
        return new DelegatingContextRunnable(task);
    }
}
